using System;
using Atlantic.XpoAutomaticProperties;
using DevExpress.Xpo;

namespace Tests.ObjectModel
{
   [XpoAutomaticProperties]
   public class Order : Entity
   {
      #region Constructors

      public Order()
      {
      }

      public Order(Session session) : base(session)
      {
      }

      #endregion

      #region Fields

      #endregion

      #region Properties

      [XpoIgnoreAutomaticProperty]
      public int Ignored { get; set; }

      public DateTime Date { get; set; }
      
      public decimal Total { get; set; }

      [Association("Customer-Orders")]
      public Customer Customer { get; set; }

      [Association("Customer-AllOrders", typeof(Customer))]
      public XPCollection<Customer> AllCustomers { get; private set; }


      #endregion

      /*  
            This is how you would normally do it with XPO: 
  
            private DateTime date;
            public DateTime Date
            {
               get { return date; }
               set { SetPropertyValue("Date", ref date, value); }
            }
      
            private decimal total;
            public decimal Total
            {
               get { return total; }
               set { SetPropertyValue("Total", ref total, value); }
            }

       */
   }
}